package cn.yangliu.nacos.oauth2.repository;

import cn.yangliu.jpa.base.repository.BaseRepository;
import cn.yangliu.nacos.oauth2.entity.Oauth2Client;
import org.springframework.data.jpa.repository.Modifying;

/**
 * The interface Oauth 2 client repository.
 *
 * @author 问道于盲
 * @date 2019 -12-11
 */
public interface Oauth2ClientRepository extends BaseRepository<Oauth2Client, Long> {

    /**
     * Find by client id oauth 2 client.
     *
     * @param clientId the client id
     * @return the oauth 2 client
     */
    Oauth2Client findByClientId(String clientId);

    /**
     * Delete by client id.
     *
     * @param clientId the client id
     */
    @Modifying
    void deleteByClientId(String clientId);
}
